package com.cms.common.util;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

import org.springframework.core.convert.converter.Converter;

public class DateConverter implements Converter<String, Date>{

	private final static SimpleDateFormat formater = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");

	@Override
	public Date convert(String text) {
	    try {  
	        return formater.parse(text);  
	    } catch (ParseException e) {  
	        // TODO Auto-generated catch block  
	    	 return new Date(); 
	    }         
	   
	}
}
